# 作业：
# [1, 2, 3, "str111","asdasd","qwdsa3d165",1,2,3,"asdqw","小天才","QA"]
# 1、删除列表里所有字符串对象
# list1 = [1, 2, 3, "str111","asdasd","qwdsa3d165",1,2,3,"asdqw","小天才","QA"]
# for item in list1[::-1]:
#     if isinstance(item, str):
#         list1.remove(item)
# print(list1)
# 2、删除列表中重复的元素
# list1 = [1, 2, 3, "str111", "asdasd", "qwdsa3d165", 1, 2, 3, "asdqw", "小天才", "QA"]
# new_list = list(set(list1))
# print(new_list)
# 3、l1 = [1, 2, 3, 4, 5]
# （1）在l1的元素3后面插入300
# l1 = [1, 2, 3, 4, 5]
# l1.pop(3)
# l1.pop(3)
# list2 = [300,4,5]
# new_list = l1 + list2
# print(new_list)
# （2）删除元素2
# l1 = [1, 2, 3, 4, 5]
# l1.pop(1)
# print(l1)
# （3）将5更改为500
# l1 = [1, 2, 3, 4, 5]
# l1[4] = 500
# print(l1)
# （4）将2，3，4切片出来
# l1 = [1, 2, 3, 4, 5]
# l2 = l1[1:4]
# print(l2)
# （5）l1[-3:-5]的结果
# l1 = [1, 2, 3, 4, 5]
# l2 = l1[-3:-5]
# print(l2)
# （6）l1[-3:]的结果
# l1 = [1, 2, 3, 4, 5]
# l2 = l1[-3:]
# print(l2)
#  2. 通过input引导用户输入一个姓名，判断该姓名是否存在于列表names中
# names = ["xi","eric","alvin","george"]
# name = input("输入姓名")
# if name in names[0:]:
#     print("名字在列表内")
# elif name not in names[0:]:
#     print("名字不在列表内")
# 4、l = [1,2,3,[4,5]]
# （1）将4修改为400
# l = [1,2,3,[4,5]]
# l[3] = [400,5]
# print(l)
# （2）在l的[4，5]列表中追加一个6，即使l变为[1,2,3,[4,5,6]]
# l = [1,2,3,[4,5]]
# l[3] = [4,5,6]
# print(l)
# 5、'''小明去超市购买水果，账单如下
# 苹果  32.8
# 香蕉  22
# 葡萄  15.5
# 请将上面的数据存储到字典里，可以根据水果名称查询购买这个水果的费用
# 很简单哦，用水果名称做key，金额做value，创建一个字典
# '''
# dict1 = {}
# dict1.update({"苹果":"32,8","香蕉":"22","葡萄":"15.5"})
# print(dict1)
# print(dict1['苹果'])
# print(dict1['香蕉'])
# print(dict1['葡萄'])
# 6、
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# 字典的长度是多少
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# print(len(dic))
# 请修改'java' 这个key对应的value值为98
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# dic['java'] = 98
# print(dic)
# 删除 c 这个key
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# del dic['c']
# print(dic)
# 增加一个key-value对，key值为 php, value是90
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# dic.update({'php':90})
# print(dic)
# 获取所有的key值，存储在列表里
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# print(dic.items())
# for i in dic.items():
#     print(i)
# new_list = []
# new_list.append(dic.items())
# print(new_list)
# 获取所有的value值，存储在列表里
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# new = []
# print(dic.values())
# new.append(dic.values())
# print(new)
# 判断 javascript 是否在字典中
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# for i in dic:
#     if i == 'javascript':
#         print("javascript 在字典中")
#     else:
#         print("javascript 不在字典中")
# 获得字典里所有value 的和
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# print(dic.get('python')+dic.get('java')+dic.get('c'))
# 获取字典里最大的value
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# for i in dic.values():
#     print(i)
# 获取字典里最小的value
# dic = {
#     'python': 95,
#     'java': 99,
#     'c': 100
# }
# for i in dic.values():
#     print(i)
# 字典 dic1 = {'php': 97}， 将dic1的数据更新到dic中
dic = {
    'python': 95,
    'java': 99,
    'c': 100
}
dic1 = {'php': 97}
dic.update(dic1)
print(dic)
# list1 = [12,45,78,12,45,78,12,77,99,53,6,93]
# 7、将重复的列表值加到一个新的字典里，key为数字，value为出现的次数
# 8、求出列表里最大的数是多少（不允许用sort等其他内置函数去做）,以及这个数所在的索引位置





















